/**
 * 导航位
 * @author hanson
 */
define(['jquery', 'jquery-validate-messages_zh'], function($, Validate){
	
	var Page = {}, DOM;
	
	function init(){
		DOM = {
				form: $('#form'),
				btnSubmit: $('#btnSubmit')
		}
	}
	
	Page.main = function(){
		init();
		handleEvent();
	}
	
	function handleEvent(){
		// 表单校验
		DOM.form.validate({
			rules : {
				name:{required:true},
				code:{required:true}
			},
		});
		
		// 提交表单
		DOM.btnSubmit.click(function(){
			if(DOM.form.valid()){
				DOM.form.submit();
			}
		});
	}
	
	return Page;
});